<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of web
 *
 * @author vitoco
 */
class web {
    private $db = null;
    
    public function __construct($db) {
	if ($db !== null) $this->db = $db;
    }
    
    public function listaSedes(){
        if (!$this->db->Query("SELECT suc_id,suc_nombre FROM sucursales where tes_id = 1")){
            echo $this->db->Kill();
        }
        else{
            $arr = json_decode($this->db->GetJSON(),true);
            foreach ($arr as $value) {
                $resul .= '<option value="'.$value['suc_id'].'">'.utf8_decode($value['suc_nombre']).'</option>';
            }
            return $resul;
        }
    }
}

?>